﻿using Exam.infranstuctrue.Tools.Attributes;
using ServiceStack.Redis;

namespace Exam.infranstuctrue.Tools
{
    /// <summary>
    /// 会话
    /// </summary>
    [IProvider, Iinjection]
    public class Session
    {
        /// <summary>
        /// 用户uid
        /// </summary>
        public string? Uid { get; set; }

        /// <summary>
        /// 获取token
        /// 获取token
        /// </summary>
        /// <returns></returns>
        public string GetToken()
        {
            RedisClient Redis = new("101.43.203.224", 6379, "Change320532132@");
            var token = Redis.Get<string>(this.Uid);
            return token;
        }
    }
}
